Repository navigation
feat(gesture): pinch an element by ref or selector - #4998
Conversation
gesture pinch now takes an element (`gesture pinch <scale> <@ref|selector>`, MCP `element`) in place of x/y. The runtime resolves it through the same target resolution as drag and pinches around the element's touch point; a recorded .ad line stores the selector, not the session ref. Without an element or origin the pinch still centers on the screen, which misses an off-center image. Unknown `pinch` and `zoom` commands now suggest the gesture pinch shape. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…refs element is refused on gesture kinds other than pinch instead of being dropped, a pinch checks the backend's gesture support before resolving its element, and a recorded pinch whose element ref never resolved to a selector is refused at save time like an unresolved drag endpoint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Size Report
Startup median (7 runs, lower is better):
|
… script write failure Splits pinch payload reading out of readGesturePayload, which the change pushed over the complexity threshold, and folds the two identical script write failure wrappers into one helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mple The help first screen keeps its key rules within 30 lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 3 new findings on 9fa7b72. The verdict and the full list are in the summary comment.
…tra arguments Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Apex Sentinel · ✅ Approve · review of
|
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
|
The code is ready at 724715b. Checks are still running: Smoke Tests (macos) and one other check are in progress, and none has failed yet. Smoke Tests cover the CLI gesture routes this diff touches, so a failure there would need a closer look. There are no conflicts. Device evidence comes from an earlier commit (435f4bf) on an iPhone 17 Pro simulator; the device-facing code is unchanged since then by diff. Not verified here: Android element pinch, local test runs, and whether replay heal or repair treats pinch selectors specially. Not blocking, take or leave: (1) gesture-command.ts:98 copies the drag token-to-target mapping and point check, so one shared gesture-target resolver would stop the two from drifting; (2) a replayed pinch on an element skips the replay target check that drag gets in interaction-gesture.ts:154, which fits a follow-up issue; (3) the unresolved-ref refusal at save time in session-script-writer.ts:394 only applies to repair-armed or publishing writes, the same as drag, and has no typed reason yet; (4) no daemon-level test drives a pinch on Of the earlier inline threads, the one on the refusal text is fixed at this commit (#4998 (comment)), and the one on extra pinch arguments is fixed too (#4998 (comment)). The one on |
Summary
gesture pinchnow takes an element in place of x/y:gesture pinch <scale> <@ref|selector>on the CLI andelementon the MCPgesturetool. The element is resolved like a drag target and the pinch centers on its touch point. Refs pass drag's ref-frame admission. A recorded.adline stores the selector, and an unresolved ref is refused at save time.elementon other gesture kinds is refused.Unknown
pinchandzoomcommands now suggestgesture pinch <scale> <@ref|selector>.Reason: a pinch without coordinates lands at the screen center and misses an off-center image. Agents tried
gesture pinch 2 @e17first, then had to compute coordinates.Before / after
Test app, iPhone 17 Pro simulator, off-center gesture image:
gesture pinch 1.5gesture pinch 1.5 @e17gesture origin requires both x and y coordinatespinch 2 @e17Unknown command: pinch.Sonnet pinch task, 4 runs per arm, all passed: CLI median 8 → 4 turns, $0.031 → $0.016. MCP median 11.5 → 6.5 turns, $0.076 → $0.044.
Validation
element(→ 1.39). The saved script recordedgesture "pinch" 1.5 "id=\"gesture-target-image\"", and replaying it on a fresh app pinched (→ 1.39).🤖 Generated with Claude Code